<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>AdminLTE 2 | Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.4 -->
    <link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons -->
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="__PUBLIC__/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link href="__PUBLIC__/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <!-- ADD THE CLASS layout-top-nav TO REMOVE THE SIDEBAR. -->
  <body class="skin-blue layout-top-nav">
    <div class="wrapper">

      <header class="main-header">               
        <nav class="navbar navbar-static-top">
          <div class="container">
            <div class="navbar-header">
              <a href="__URL__" class="navbar-brand"><b>Admin</b>LTE</a>
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
                <i class="fa fa-bars"></i>
              </button>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
              <ul class="nav navbar-nav">
                <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
                  <ul class="dropdown-menu" role="menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                    <li><a href="#">Something else here</a></li>
                    <li class="divider"></li>
                    <li><a href="#">Separated link</a></li>
                    <li class="divider"></li>
                    <li><a href="#">One more separated link</a></li>
                  </ul>
                </li>
              </ul>
              <form class="navbar-form navbar-left" role="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="navbar-search-input" placeholder="Search">
                </div>
              </form>                          
            </div><!-- /.navbar-collapse -->
            <!-- Navbar Right Menu -->
              <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                  <!-- Messages: style can be found in dropdown.less-->
                  <li class="dropdown messages-menu">
                    <!-- Menu toggle button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-envelope-o"></i>
                      <span class="label label-success">4</span>
                    </a>
                    <ul class="dropdown-menu">
                      <li class="header">You have 4 messages</li>
                      <li>
                        <!-- inner menu: contains the messages -->
                        <ul class="menu">
                          <li><!-- start message -->
                            <a href="#">
                              <div class="pull-left">
                                <!-- User Image -->
                                <img src="__PUBLIC__/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
                              </div>
                              <!-- Message title and timestamp -->
                              <h4>
                                Support Team
                                <small><i class="fa fa-clock-o"></i> 5 mins</small>
                              </h4>
                              <!-- The message -->
                              <p>Why not buy a new awesome theme?</p>
                            </a>
                          </li><!-- end message -->
                        </ul><!-- /.menu -->
                      </li>
                      <li class="footer"><a href="#">See All Messages</a></li>
                    </ul>
                  </li><!-- /.messages-menu -->

                  <!-- Notifications Menu -->
                  <li class="dropdown notifications-menu">
                    <!-- Menu toggle button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-bell-o"></i>
                      <span class="label label-warning">10</span>
                    </a>
                    <ul class="dropdown-menu">
                      <li class="header">You have 10 notifications</li>
                      <li>
                        <!-- Inner Menu: contains the notifications -->
                        <ul class="menu">
                          <li><!-- start notification -->
                            <a href="#">
                              <i class="fa fa-users text-aqua"></i> 5 new members joined today
                            </a>
                          </li><!-- end notification -->
                        </ul>
                      </li>
                      <li class="footer"><a href="#">View all</a></li>
                    </ul>
                  </li>
                  <!-- Tasks Menu -->
                  <li class="dropdown tasks-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-flag-o"></i>
                      <span class="label label-danger">9</span>
                    </a>
                    <ul class="dropdown-menu">
                      <li class="header">You have 9 tasks</li>
                      <li>
                        <!-- Inner menu: contains the tasks -->
                        <ul class="menu">
                          <li><!-- Task item -->
                            <a href="#">
                              <!-- Task title and progress text -->
                              <h3>
                                Design some buttons
                                <small class="pull-right">20%</small>
                              </h3>
                              <!-- The progress bar -->
                              <div class="progress xs">
                                <!-- Change the css width attribute to simulate progress -->
                                <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                                  <span class="sr-only">20% Complete</span>
                                </div>
                              </div>
                            </a>
                          </li><!-- end task item -->
                        </ul>
                      </li>
                      <li class="footer">
                        <a href="#">View all tasks</a>
                      </li>
                    </ul>
                  </li>
                  <!-- User Account Menu -->
                  <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                      <!-- The user image in the navbar-->
                      <img src="__PUBLIC__/dist/img/user2-160x160.jpg" class="user-image" alt="User Image"/>
                      <!-- hidden-xs hides the username on small devices so only the image appears. -->
                      <span class="hidden-xs"><?php echo getUserName(); ?></span>
                    </a>
                    <ul class="dropdown-menu">
                      <!-- The user image in the menu -->
                      <li class="user-header">
                        <img src="__PUBLIC__/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image" />
                        <p>
                          <?php echo getUserName(); ?> - Web Developer
                          <small>Member since Nov. 2012</small>
                        </p>
                      </li>
                      <!-- Menu Body -->
                      <li class="user-body">
                        <div class="col-xs-4 text-center">
                          <a href="#">Followers</a>
                        </div>
                        <div class="col-xs-4 text-center">
                          <a href="#">Sales</a>
                        </div>
                        <div class="col-xs-4 text-center">
                          <a href="#">Friends</a>
                        </div>
                      </li>
                      <!-- Menu Footer-->
                      <li class="user-footer">
                        <div class="pull-left">
                          <a href="#" class="btn btn-default btn-flat">Profile</a>
                        </div>
                        <div class="pull-right">
                          <a href="__APP__/Public/logout" class="btn btn-default btn-flat">Sign out</a>
                        </div>
                      </li>
                    </ul>
                  </li>
                </ul>
              </div><!-- /.navbar-custom-menu -->
          </div><!-- /.container-fluid -->
        </nav>
      </header>
      <!-- Full Width Column -->
      <div class="content-wrapper">
        <div class="container">
          <!-- Content Header (Page header) -->
          <section class="content-header">
            <h1>
              Top Navigation
              <small>Example 2.0</small>
            </h1>
            <ol class="breadcrumb">
              <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
              <li class="active">Dashboard</li>
            </ol>
          </section>

            <!-- Main content -->
    <section class="content">
      <!-- Small boxes (Stat box) -->
      <div class="row">
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-aqua">
            <div class="inner">
              <h3>150</h3>
              <p>New Orders</p>
            </div>
            <div class="icon">
              <i class="ion ion-bag"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div><!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-green">
            <div class="inner">
              <h3>53<sup style="font-size: 20px">%</sup></h3>
              <p>Bounce Rate</p>
            </div>
            <div class="icon">
              <i class="ion ion-stats-bars"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div><!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-yellow">
            <div class="inner">
              <h3>44</h3>
              <p>User Registrations</p>
            </div>
            <div class="icon">
              <i class="ion ion-person-add"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div><!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-red">
            <div class="inner">
              <h3>65</h3>
              <p>Unique Visitors</p>
            </div>
            <div class="icon">
              <i class="ion ion-pie-graph"></i>
            </div>
            <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
          </div>
        </div><!-- ./col -->
      </div><!-- /.row -->
      <!-- Main row -->
      <div class="row">
        <!-- Left col -->
        <section class="col-lg-7 connectedSortable">
      
          <div class="nav-tabs-custom">
            <!-- Tabs within a box -->
            <ul class="nav nav-tabs pull-right">
              <li class="active"><a href="#c6-todo" data-toggle="tab">C6 {$Think.lang.To Do List}</a></li>
              <li><a href="#c6-toread" data-toggle="tab">C6 {$Think.lang.To Read List}</a></li>
              <li><a href="<?php echo $c6_login_url ?>" target="_blank">C6</a></li>
              <li class="pull-left header"><i class="fa fa-inbox"></i> C6</li>
            </ul>
            <div class="tab-content no-padding">
              <!-- Morris chart - Sales -->
              <div class="  tab-pane active" id="c6-todo" style="position: relative; height: 300px;">
                  <!-- TO DO List -->
                    <div class="box box-primary" id="todo-lists">
                      <div class="box-body">
                        <ul class="todo-list">
                        </ul>
                      </div><!-- /.box-body -->
                    </div><!-- /.box -->

              </div>
              <div class=" tab-pane" id="c6-toread" style="position: relative; height: 300px;">
                  <!-- TO DO List -->
                  <div class="box box-primary" id="toreader-rlists">
                    <div class="box-body">
                      <ul class="todo-list">
                       
                      </ul>
                    </div><!-- /.box-body -->
                  </div><!-- /.box -->
              </div>
            </div>
          </div>


          <!-- Forun Chat box -->
          <div class="box box-success">
            <div class="box-header">
              <i class="fa fa-comments-o"></i>
              <h3 class="box-title">{$Think.lang.Forun Chat}</h3>
              <div class="box-tools pull-right">
                  <a href="{$forum_login_url}" target="_blacnk">forum</a>
              </div>
            </div>
            <div class="box-body chat" id="chat-box">
            <?php 
                Vendor('Forum.ForumApi');
                $ForumApi = new \ForumApi();
             ?>
            <?php foreach ($forumMessageList as $key => $item) {  ?>
              
              <!-- chat item -->
              <div class="item">
                <img src="<?php echo $item->UserPic; ?>" alt="user image" class="online" onerror="javascript:this.src='http://oa.yigong100.com:55556/images/common/noavatar_small.gif';" alt="pic"/>

                <p class="message">
                  <a href="#" class="name">
                    <small class="text-muted pull-right"><i class="fa fa-clock-o"></i> <?php echo $item->MessageTime; ?></small>
                    <small class="text-muted pull-right" style="margin-right:10px"> {$Think.lang.Views}：<?php echo $item->Views ?> </small>
                    <small class="text-muted pull-right" style="margin-right:10px"> {$Think.lang.Replies}：<?php echo $item->Replies ?></small>
                   <?php echo $item->MessageUser; ?>
                  </a>
                  <a href="<?php echo $ForumApi->getTitleUrl($item->MessageTid); ?>" target="_blank">
                  <?php echo $item->MessageTitle; ?>
                  </a>
                </p>

              </div><!-- /.item -->

            <?php } ?>
            </div><!-- /.chat -->

          </div><!-- /.box (chat box) -->

        </section><!-- /.Left col -->
        <!-- right col (We are only adding the ID to make the widgets sortable)-->
        <section class="col-lg-5 connectedSortable">

                  <!-- quick email widget -->
          <!-- TO DO List -->
          <div class="box box-primary" id="mail-lists">
            <div class="box-header">
              <i class="fa fa-envelope"></i>
              <h3 class="box-title">{$Think.lang.Mail List}</h3>
              <div class="box-tools pull-right">

                <a href="{$exmail_login_url}" target="_blank">login</a>
              </div>
            </div><!-- /.box-header -->
            <div class="box-body">
              <ul class="todo-list">
                  <?php foreach ($expmailData as $key => $val) {
                    ?>
                    <li>
                      <!-- drag handle -->
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                      <span><?php  preg_match("{\\"(.*?)\\"}s",$val->Sender,$matchs); echo $matchs[1]; ?></span>
                      <span class="mailbox-subject"><a href="javascript:;" data="<?php echo $val->MailID ?>" class="reJumpUrl" target="_black">
                      <strong> <?php echo $val->Subject ?> </strong></a></span>
                      <!-- Emphasis label -->
                      <small class="label label-danger mailbox-date"><i class="fa fa-clock-o"></i> <?php echo date('Y-m-d',$val->Time); ?></small>

                    </li>

                  <?php } ?>
              </ul>
            </div><!-- /.box-body -->
          </div><!-- /.box -->

        </section><!-- right col -->
      </div><!-- /.row (main row) -->
    </section><!-- /.content -->
        </div><!-- /.container -->
      </div><!-- /.content-wrapper -->
      <footer class="main-footer">
        <div class="container">
          <div class="pull-right hidden-xs">
            <b>Version</b> 2.0
          </div>
          <strong>Copyright &copy; 2014-2015 <a href="#">yigong Studio</a>.</strong> All rights reserved.
        </div><!-- /.container -->
      </footer>
    </div><!-- ./wrapper -->

    <!-- jQuery 2.1.4 -->
    <script src="__PUBLIC__/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="__PUBLIC__/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <!-- SlimScroll -->
    <script src="__PUBLIC__/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='__PUBLIC__/plugins/fastclick/fastclick.min.js'></script>
    <!-- AdminLTE App -->
    <script src="__PUBLIC__/dist/js/app.min.js" type="text/javascript"></script>
       <script src="__PUBLIC__/dist/js/jquery.form.js" type="text/javascript"></script>
    <!-- custom extends js -->
    <script src="__PUBLIC__/dist/js/custom.extends.js" type="text/javascript"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="__PUBLIC__/plugins/jQueryUI/jquery-ui.min.js" type="text/javascript"></script>
    <script src='__PUBLIC__/js/CommonPerson.js'></script>

    <link href="__PUBLIC__/js/showLoading.css" rel="stylesheet" type="text/css" />
   
    <script type="text/javascript">
  
  $(function() {

    $(".todo-list").sortable({
      placeholder: "sort-highlight",
      handle: ".handle",
      forcePlaceholderSize: true,
      zIndex: 999999
    });

  $(".connectedSortable").sortable({
    placeholder: "sort-highlight",
    connectWith: ".connectedSortable",
    handle: ".box-header, .nav-tabs",
    forcePlaceholderSize: true,
    zIndex: 999999
  });
    $(".connectedSortable .box-header, .connectedSortable .nav-tabs-custom").css("cursor", "move");

    $('#chat-box').slimScroll({
      height: '300px'
    });

    //获取c6 单点登陆的链接
    var  jump =  '<?php echo $c6_login_url; ?>';
 

     //如果存在代阅信息，读取数据并且显示
    <?php if ($flat_info_waiting) : ?>
      writeJsonInfo('<?php echo $flat_info_waiting; ?>','#toreader-rlists');
    <?php  endif; ?>

     //如果存在代办事件，读取数据并且显示
    <?php if ($pending_work_list) : ?>
      writeJsonInfo('<?php echo $pending_work_list; ?>','#todo-lists');
    <?php  endif; ?>
    
    function writeJsonInfo(object,id) {
        var  rdata  = $.parseJSON(object);
        var  rlists = rdata.MessageList;
        for (var k in rlists) {
            var html = '<li> <span class="handle"><i class="fa fa-ellipsis-v"></i> <i class="fa fa-ellipsis-v"></i></span>';
            html += '<span class="text">'+rlists[k].ModuleTypeName+' : <a href="'+jump+rlists[k].MessageUrl+'" target="_blank">'+rlists[k].MessageTitle +'</a></span>';
            var day1 = new Date(rlists[k].SendTime);
            var day2 = new Date();
            var days=Math.floor((day2-day1)/(24*3600*1000));
            html += ' <small class="label label-danger"><i class="fa fa-clock-o"></i>'+ days +' days</small>';
            html += '</li>';
            $(id+' ul.todo-list').append(html);  
        };
    }
  });

  $('.reJumpUrl').bind('click',function(){
    var mailid = $(this).attr('data');
    var object = $(this);

    CommonPerson.Base.LoadingPic.FullScreenShow();
    $.post("__APP__/Public/getReadMailUrl",{
      mailid:mailid
    }).done(function(data){
        object.attr('href',data);
        object.unbind("click");
        CommonPerson.Base.LoadingPic.FullScreenHide();
        window.open(data, '_blank');
    });
  });
  </script>
  </body>
</html>
